<%@ page import="entity.Passage" %>
<%@ page import="entity.Field" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String course = (String) request.getAttribute("courseName");
    String bottom_content  = (String) request.getAttribute("bottom_content");
    String operatorName = (String) request.getAttribute("operatorName");
    Passage passage = (Passage) request.getAttribute("passage");
    String content = passage.getContent();
    content = content.replaceAll(" ", "&nbsp;");
    content = content.replaceAll("\t", "&nbsp;&nbsp;");
    content = content.replaceAll("\r\n", "<br/>");
    Field field = (Field) request.getAttribute("field");
%>
<html>
<head>
    <title><%=course%>精品课程</title>
    <link type="text/css" rel="stylesheet" href="css/common.css"/>
    <link type="text/css" rel="stylesheet" href="css/passage.css"/>
    <script type="text/javascript" src="js/common.js"></script>
</head>
<body>

<div id="top">
    <img  src="image/top.png" style="width: 1349px; height: 249px; position: absolute">
    <h1 style="font-size: 30px; color:white; position:absolute;padding-left: 250px; padding-top: 100px; margin: 0"><%=course%>精品课程</h1>

    <form action="SearchAllServlet" method="post" style="position: absolute; padding-left: 764px;padding-top: 174px; margin:0">
        <span style="color: orange">全站搜索</span>
        <input type="text" name="searchAll" id="searchAll" style="width:200px" placeholder="请输入搜索内容" />
        <input onclick="return check() " type="submit" style="background-color: #e8b108; border-color: yellow;border-left: 0;border-right: 0" value="搜索" />
    </form>

    <ul id="nav">
        <li class="sub_nav"><a href="IndexServlet" style="text-decoration: none;color:white">首页</a></li>
        <li class="sub_nav"><a href="FieldServlet?field=11" style="text-decoration: none;color:white">课程介绍</a></li>
        <li class="sub_nav"><a href="FieldServlet?field=21" style="text-decoration: none;color:white">教学团队</a></li>
        <li class="sub_nav"><a href="FieldServlet?field=31" style="text-decoration: none;color:white">课程建设</a></li>
        <li class="sub_nav"><a href="FieldServlet?field=41" style="text-decoration: none;color:white">课程资源</a></li>
        <li class="sub_nav"><a href="FieldServlet?field=61" style="text-decoration: none;color:white">问题与答疑</a></li>
        <li class="sub_nav"><a href="FieldServlet?field=51" style="text-decoration: none;color:white">课程研究</a></li>
        <li class="sub_nav"><a href="MessageServlet?page=1" style="text-decoration: none;color:white">留言板</a></li>
    </ul>

</div>

<div id="content" >
    <div class="passage_message">
        <span style="margin: 0;padding-left: 6px; line-height: 32px;">
            你的当前位置：
            <a href="IndexServlet" class="link">首页</a>>
            <%if(field != null){%>
            <a href="FieldServlet?field=<%=field.getFieldID()%>" class="link"><%=field.getFieldName()%>></a>
            <%}%>
            <%=passage.getTitle()%>
            &nbsp;发布人：<%=operatorName%>
            &nbsp;创建时间：<%=passage.getCreateDate()%>
        </span>
    </div>

    <h1 style="text-align: center;"><%=passage.getTitle()%></h1>
    <p id="passage_content"><%=content%></p>

    <div class="passage_message" style="text-align: right;">
        <span style="margin: 0;padding-right: 6px;line-height: 32px;">
            <a href="<%if(field != null){%>FieldServlet?field=<%=field.getFieldID()%><%}else{%>IndexServlet<%}%>" style="color:red" class="link">返回</a>
            阅读次数：<%=passage.getCount()%>
        </span>
    </div>



</div>

<div id="bottom">
    <div id="bottom1"></div>
    <div style="height: 2px"></div>
    <div id="bottom2">
        <div>
            <p style="text-align: center; margin: 0; padding: 32px 0 12px 0"><%=bottom_content%></p>
        </div>
    </div>
</div>


</body>
</html>